package com.bruce.service;

import com.bruce.UserInterface;
import com.spring.inter.BeanNameAware;
import com.spring.inter.InitializingBean;
import com.spring.annotation.Autowired;
import com.spring.annotation.Component;

/**
 * @author Bruce
 */
@Component("userService")
//@Scope("prototype")
public class UserService implements BeanNameAware, InitializingBean, UserInterface {

    @Autowired
    private OrderService orderService;

    private String beanName;

    @Override
    public void setBeanName(String name) {
        beanName = name;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("init...");
    }

    public void test() {
        System.out.println(orderService);
        System.out.println(beanName);
    }

}
